package com.chen.nongansampling.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.chen.nongansampling.R;
import com.chen.nongansampling.bean.AddOperatorBean;
import com.chen.nongansampling.bean.tanchubean;

import java.util.List;

public class ListViewItemAdapter extends BaseAdapter {

    public List<tanchubean> list;
    private Context activity;
    public AddOperatorBean addOperatorBean;


    public ListViewItemAdapter(Context activity,List<tanchubean> list) {
        this.list = list;
        this.activity = activity;
    }
    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View view = LayoutInflater.from(activity).inflate(R.layout.item, null);

        TextView name = (TextView) view.findViewById(R.id.itemshow);

        name.setText(list.get(position).getName());
        return view;
    }
}
